package ICM.client;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.IOException;
import java.util.Vector;

import javax.swing.*;
import javax.swing.table.DefaultTableModel;

import com.jgoodies.forms.factories.DefaultComponentFactory;

import common.CommandMessage;
import common.User;
import java.awt.Font;

public class Reports extends JPanel {
	
	private ClientUI ui;
	private Client c;
	private User[] users = null;
	private JTable table;
	private DefaultTableModel defaultModel = null;
	private Vector newRow = null;
	private JButton btnStatisticInfo;
	private JButton btnEmployeesInfo;
	private JButton btnBack;
	private JButton btnRequestsInfo;
	
	public Reports(final Client c, final ClientUI ui) {
		this.c = c;
		this.ui = ui;
		setLayout(null);
		
		JLabel lblReports = DefaultComponentFactory.getInstance().createTitle("Reports");
		lblReports.setBounds(209, 11, 38, 14);

		lblReports.setFont(new Font("Tahoma", Font.PLAIN, 26));
		lblReports.setBounds(281, 11, 129, 39);
		add(lblReports);
		
		btnBack = new JButton("Back", new ImageIcon(Reports.class.getResource("/client/images/back.png")));
		btnBack.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				try {
					ui.SetContent(ClientUI.Main_Screen);
				} catch (Exception e1) {
					// TODO Auto-generated catch block
					e1.printStackTrace();
				} 
			}
		});
		btnBack.setBounds(21, 230, 109, 41);
		add(btnBack);
		
		// Prepare all users.
				btnEmployeesInfo = new JButton("Employees Info" ,new ImageIcon(Reports.class.getResource("/client/images/information.png")) );
				btnEmployeesInfo.addActionListener(new ActionListener() {
					public void actionPerformed(ActionEvent e) {
						try {
							ui.SetContent(ClientUI.EmployeesInfo_Screen);
						} catch (Exception e1) {
							// TODO Auto-generated catch block
							e1.printStackTrace();
						} 
					}
				});
				btnEmployeesInfo.setBounds(153, 230, 175, 41);
				add(btnEmployeesInfo);
				
				btnStatisticInfo = new JButton("Statistic Info" , new ImageIcon(Reports.class.getResource("/client/images/stats.png")));
				btnStatisticInfo.addActionListener(new ActionListener() {
					public void actionPerformed(ActionEvent e) {
						try {
							ui.SetContent(ClientUI.StatisticInfo_screen);
						} catch (Exception e1) {
							// TODO Auto-generated catch block
							e1.printStackTrace();
						} 
					}
				});
				btnStatisticInfo.setBounds(531, 231, 156, 39);
				add(btnStatisticInfo);
				
				btnRequestsInfo = new JButton("Requests Info", new ImageIcon(Reports.class.getResource("/client/images/information.png")));
				btnRequestsInfo.addActionListener(new ActionListener() {
					public void actionPerformed(ActionEvent e) {
						try {
							ui.SetContent(ClientUI.RequestsInfo_screen);
						} catch (Exception e1) {
							// TODO Auto-generated catch block
							e1.printStackTrace();
						} 
					}
				});			
				btnRequestsInfo.setBounds(358, 230, 150, 41);
				add(btnRequestsInfo);
}

}
